module app

import os
import vweb

pub enum State {
    up = 0
	down 
	starting 
	waiting	
}

fn get_html() string {
	return ''
}

pub struct App {
	vweb.Context 
    mut:
        state State = .down
}

pub fn (mut app App) index() vweb.Result {
 	file := os.read_file('views/index.html') or {
		panic('Failed to open views/index.html')
	}
    return app.html(file)
}

pub fn (mut app App) about() vweb.Result {
 	file := os.read_file('views/about.html') or {
		panic('Failed to open views/about.html')
	}
    return app.html(file)
}

pub fn (mut app App) whoami() vweb.Result {
	file := os.read_file('views/whoami.html') or {
		panic('Failed to open views/whoami.html')
	}
	return app.html(file)
}
